package com.qut.system_1.controller;

import com.qut.system_1.mapper.doctor_mapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController // 作为控制器使用
@RequestMapping("/user")  // 把对URL的请求映射到控制器
public class doctor_controller {
    @Resource // 注入依赖（点击）
    private doctor_mapper aa;

    @RequestMapping("/doctor_search")  // 映射到方法，接下来定义方法？？？？
    public List<Map<String,Object>> doctor_search(@RequestParam Map<String,String> param){
        List<Map<String,Object>> list=null;
        list=aa.search(param);
        return list;
    }
    @RequestMapping("/doctor_add")
    public int doctor_add(@RequestParam Map<String,String> param) {
        int re=0;
        re=aa.save(param);
        return re;
    }

    @RequestMapping("/doctor_edit")
    public int doctor_edit(@RequestParam Map<String,String> param) {
        int re=0;
        re=aa.edit(param);
        return re;
    }

    @RequestMapping("/doctor_delete")
    public int doctor_delete(String[] ids){
        int row=0;
        row=aa.delete(ids);
        return row;
    }

}
